home *** CD-ROM | disk | FTP | other *** search
Wrap
/*************************************/ /* Image Engineer Macro script */ /* by Simon Edwards */ /* 5/6/95 */ /* Merge Scans */ /*************************************/ Options results signal on error /* Setup a place for errors to go */ 'GET PRIMARY' primary=RESULT if primary="" then do 'REQUEST "No image has been marked as PRIMARY" "Doh!"' exit end 'GET SECONDARY' secondary=RESULT if secondary="" then do 'REQUEST "No image has been marked as SECONDARY" "Doh!"' exit end 'PROJECT_INFO "'||primary||'" BOX' coords=RESULT px=word(coords,1) py=word(coords,2) 'PROJECT_INFO "'||secondary||'" BOX' coords=RESULT sx=word(coords,1) sy=word(coords,2) 'PROJECT_INFO "'||primary||'" WIDTH' pwidth=RESULT 'PROJECT_INFO "'||secondary||'" WIDTH' swidth=RESULT 'PROJECT_INFO "'||primary||'" HEIGHT' pheight=RESULT 'PROJECT_INFO "'||secondary||'" HEIGHT' sheight=RESULT cx=px-sx cy=py-sy if cx<0 then resizexoffset=0-cx else resizexoffset=0 if cy<0 then resizeyoffset=0-cy else resizeyoffset=0 if cx<0 then cleft=cx else cleft=0 if pwidth<cx+swidth then cright=cx+swidth else cright=pwidth resizewidth=cright-cleft if cy<0 then ctop=cy else ctop=0 if pheight<cy+sheight then cbottom=cy+sheight else cbottom=pheight resizeheight=cbottom-ctop 'RESIZE "'||primary||'"' resizewidth resizeheight resizexoffset resizeyoffset resizedimage=RESULT 'MARK "'||secondary||'" PRIMARY' 'MARK "'||resizedimage||'" SECONDARY' COMPOSITE cx+resizexoffset cy+resizeyoffset MIX 100 CLOSE resizedimage exit /*******************************************************************/ /* This is where control goes when an error code is returned by IE */ /* It puts up a message saying what happened and on which line */ /*******************************************************************/ error: if RC=5 then do /* Did the user just cancel us? */ IE_TO_FRONT LAST_ERROR 'REQUEST "'||RESULT||'"' exit end else do IE_TO_FRONT LAST_ERROR 'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!' exit end